import {ColorPicker} from 'element-ui';

export default {
  name: ColorPicker.name,
  mixins: [ColorPicker],
  methods: {
    confirmValue: function confirmValue() {
      var value = this.color.value;
      this.$emit('input', value);
      this.$emit('change', value);
      this.$nextTick(() => {
        this.dispatch('ElFormItem', 'el.form.change', value);
      });
      this.showPicker = false;
    },
    clearValue: function clearValue() {
      this.$emit('input', null);
      this.$emit('change', null);
      if (this.value !== null) {
        this.$nextTick(() => {
          this.dispatch('ElFormItem', 'el.form.change', null);
        });
      }
      this.showPanelColor = false;
      this.showPicker = false;
      this.resetColor();
    },
  },
};
